package com.song.mapper;

import com.song.pojo.Emp;
import com.song.pojo.EmpQueryParam;
import com.song.pojo.JobOption;
import org.apache.ibatis.annotations.MapKey;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.time.LocalDate;
import java.util.List;
import java.util.Map;

/*
* @description:操作员工基本信息的Mapper接口
* */
@Mapper
public interface EmpMapper {
    //分页查询员工信息
//    @Select("select emp.* , dept.name as deptName from emp\n" +
//            "left join dept on emp.dept_id = dept.id\n" +
//            "where emp.name like ``%#{name}%`` and\n" +
//            "emp.gender = 1 and emp.entry_date between #{begin} and #{end}\n" +
//            "order by emp.update_time desc")
    //分页查询员工信息
    List<Emp> getEmps(EmpQueryParam  param);

    //添加员工信息
    Integer addEmp(Emp emp);
    //删除员工信息
    Integer deleteEmp(@Param("ids") List<Integer> ids);
    //查询员工信息和员工经历
    Emp getEmpAndExpr(Integer id);
    //修改员工信息
    void updateEmp(Emp emp);
    //统计员工职位详情
    @MapKey("职位")
    List<Map<String,Object>> getEmpsJobDetail();
    //统计员工性别详情
    @MapKey("性别")
    List<Map<String,Object>> getEmpsGenderDetail();
}

